package design.factory.abstractFactory;

public class MachineFactory implements GunFactory {
    @Override
    public Gun createGun() {
        return new MachineGun();
    }
    @Override
    public Bullet createBullet() {
        return new MachineBullet();
    }
    @Override
    public Gun getALoadedGun() {
        Gun machineGun = new MachineGun();
        for (int i = machineGun
                .getChargeSize(); i < MachineGun.CHARGER_CAPACITY; i++) {
            machineGun.loading(createBullet());
        }
        return machineGun;
    }
    private MachineFactory() {}
    private static MachineFactory f = new MachineFactory();
    public static MachineFactory getFoctory() {
        return f;
    }
}
